#pragma once

#include <cstring>

#include "r_socket.h"
#include "r_socket_message.h"

namespace eniac
{

class r_socket_ipv4_udp_multicast final
{
public:
    r_socket_ipv4_udp_multicast() = delete;
    r_socket_ipv4_udp_multicast(const r_socket_ipv4_udp_multicast&) = delete;
    r_socket_ipv4_udp_multicast(r_socket_ipv4_udp_multicast&&) = delete;
    r_socket_ipv4_udp_multicast& operator=(const r_socket_ipv4_udp_multicast&) = delete;
    r_socket_ipv4_udp_multicast& operator=(r_socket_ipv4_udp_multicast&&) = delete;

    static r_socket_proxy_ret_t set_socket_property(const r_socket::ptr socket_obj, r_socket_property_type type, void* property, size_t property_size);
    static r_socket_proxy_ret_t start_socket(const r_socket::ptr socket_obj);
    static void close_socket(const r_socket::ptr socket_obj);
    static r_socket_proxy_ret_t read_message(const r_socket::ptr socket_obj, r_socket_message::ptr& message);
    static r_socket_proxy_ret_t send_message(const r_socket::ptr socket_obj, const std::vector<uint8_t>& message);

private:
    static r_socket_proxy_ret_t set_socket_multicast_address(const r_socket::ptr socket_obj, void* property, size_t property_size);
    static r_socket_proxy_ret_t set_socket_multicast_port(const r_socket::ptr socket_obj, void* property, size_t property_size);
};


}